package com.teamwings.modules.cate.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.teamwings.common.entity.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.List;

/**
 * <p>
 *    表单分类
 * </p>
 *
 * @author admin
 * @since 2021-05-05
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("FORM_TABLE_CATE")
public class FormTableCate extends BaseEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键id
     */
    @TableId(value = "ID")
    private String id;

    /**
     * 父亲id
     */
    @TableField("PID")
    private String pid;

    /**
     * 分类名称
     */
    @TableField("NAME")
    @ApiModelProperty(example = "基础控件")
    private String name;

    /**
     * 是否有孩子级别数据
     */
    @TableField("HAS_CHILD")
    @ApiModelProperty(example = "0")
    private Integer hasChild;

    /**
     * 用于自关联，负责存储儿子数据
     */
    @TableField(exist = false)
    private List<FormTableCate> children;

    @TableField(exist = false)
    private String key;

}
